
import {Entity, Column, Index} from 'typeorm';
import {BasisTripDataEntity} from "@/entitys/common/basisTripDataEntity";
import {CollectionType} from "@/typing/payType";

// 行程数据状态
export enum TripDataStateEnum {
    "Delete" = "-1", // 删除

    "Add" = "0", // 刚 预定/添加数据
    "OpReviewNotPass" = "1", //计调审核驳回

    "ApplyOpReview" = "2", //申请计调审核
    "OpReview" = "3", //计调审核通过
    "ReconciliationNotPass" = "4", //对账驳回

    "ApplyOpReviewReconciliation" = "5", //申请财务对账
    "Reconciliation" = "6", //对账通过

    "Archive" = "7", //归档
}


@Entity({comment: "团上行程数据"})
export class TripData extends BasisTripDataEntity {
    @Column({comment: '行程数据状态', type: "enum", enum: TripDataStateEnum, default: TripDataStateEnum.Add})
    state: TripDataStateEnum;

    @Column({comment: '对账金额', nullable: true})
    reconciliationAmount: number;

    @Column({comment: '航班号', nullable: true})
    flightNumber: string;

    /**
     * 车辆使用 - start
     * */
    @Column({comment: '车用途', nullable: true})
    application: string;


    @Column({comment: '游客联系人', nullable: true})
    tourContactPerson: string;

    @Column({comment: '车牌', nullable: true})
    licensePlate: string;

    @Column({comment: '司机', nullable: true})
    driver: string;

    @Column({comment: '司机电话', nullable: true})
    driverPhone: string;

    /**
     * 车辆使用 - end
     * */

    /**
     * 转地接安排 - start
     * */

    @Column({comment: '地接联系人ID', nullable: true})
    contactPersonId: number;

    @Column({comment: '地接联系人电话', nullable: true})
    contactPersonPhone: number;

    @Column({comment: '成人数', default: 0})
    adult: number;

    @Column({comment: '儿童人数', default: 0})
    child: number;

    @Column({comment: '领队人数', default: 0})
    leader: number;

    @Column({comment: '老人数', default: 0})
    old: number;

    @Column({comment: '线路信息', type: "json", nullable: true})
    itineraryList: any[];

    @Column({comment: '游客名单', type: "json", nullable: true})
    touristsList: any[];

    /**
     * 地接安排 - end
     * */

    /**
     *  导游安排表- start
     * */

    @Column({comment: '接团地点', nullable: true})
    pickUpLocation: string;

    @Column({comment: '送团地点', nullable: true})
    dropOffLocation: string;

    /**
     *  导游安排表- end
     * */


    /**
     *  自费- start
     * */
    @Column({comment: '收款方式', type: "enum", enum: CollectionType, default: CollectionType.guideCollection})
    collectionType: CollectionType;
    /**
     *  自费- end
     * */


    /**
     *  购物- start
     * */
    @Column({comment: '一返', nullable: true})
    rebate1: number;

    @Column({comment: '导游返点', nullable: true})
    guideRebate: number;

    @Column({comment: '司机返点', nullable: true})
    driverRebate: number;

    @Column({comment: '其它返点', nullable: true})
    otherRebate: number;

    @Column({comment: '二返', nullable: true})
    rebate2: number;
    /**
     *  购物- end
     * */


    /**
     *  团款账单表 start
     * */
    @Column({comment: '收客订单id', nullable: true}) // 绑定到那个收客订单上
    receiveOrderId: number;
    /**
     *  团款账单表- end
     * */

    /**
     *  导游借款- start
     * */
    @Column({comment: '导游id', nullable: true})
    touristGuideId: number;
    /**
     * 导游借款 - end
     * */

}
